﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GTA.ExceptionHandling
{
    public class ValidationField
    {
        #region Properties
        public String FieldName { get; private set; }
        public String OriginalValue { get; private set; }
        public List<String> AllowedValues { get; private set; }
        #endregion

        #region Constructors
        public ValidationField() { }
        public ValidationField(String fieldName) : this(fieldName, String.Empty, null) { }
        public ValidationField(String fieldName, String originalValue) : this(fieldName, originalValue, null) { }
        public ValidationField(String fieldName, String originalValue, List<String> allowedValues)
        {
            this.FieldName = fieldName;
            this.OriginalValue = originalValue;
            this.AllowedValues = allowedValues;
        }
        #endregion

        #region Methods
        public void AddAllowedValue(String value)
        {
            if (AllowedValues == null)
                AllowedValues = new List<string>();
            AllowedValues.Add(value);
        }
        #endregion
    }
}
